<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::domain(env('WX_DOMAIN'))->group( function () {

	Route::get('login', 'DefaultController@login')->name('login');
	Route::post('login', 'DefaultController@postLogin');
	Route::get('register', 'DefaultController@register')->name('register');
	Route::post('register', 'DefaultController@postRegister');

	Route::post('sms', 'UtilController@sms')->name('sms');
	Route::post('smsRecruit', 'UtilController@smsRecruit')->name('smsRecruit');

	Route::get('/m/{uuid}', 'DefaultController@recruit')->name('recruit');
	Route::post('/m/{uuid}', 'DefaultController@postRecruit');
	Route::get('/success/{uuid}', 'DefaultController@success')->name('success');

	Route::get('content/{type}', 'DefaultController@content')->name('content');

	Route::middleware('auth')->group( function () {

		Route::get('/', 'WeixinController@index')->name('index');
			
		Route::get('logout', 'WeixinController@logout')->name('logout');
		//二维码
		Route::get('qrcode', 'WeixinController@qrcode')->name('qrcode');
		//应聘信息
		Route::get('list', 'WeixinController@list')->name('list');
		//团队成员
		Route::get('group', 'WeixinController@group')->name('group');
		Route::get('team/{uuid}', 'WeixinController@team')->name('team');
		Route::get('show/{uuid}', 'WeixinController@show')->name('show');
		Route::post('verify/{uuid}', 'WeixinController@verify')->name('verify');
		Route::get('change', 'WeixinController@change')->name('change');
		Route::post('change', 'WeixinController@postChange');

		//团队应聘信息
		Route::get('others/{uuid}', 'WeixinController@others')->name('others');

		Route::middleware('supervisor')->group( function () { 

			Route::prefix('super')->name('super.')->group( function () {
	        	Route::get('rank', 'SuperController@rank')->name('rank');
				Route::get('manage', 'SuperController@manage')->name('manage');
				Route::get('statistics', 'SuperController@statistics')->name('statistics');
				Route::get('text/{type}', 'SuperController@text')->name('text');
				Route::post('text', 'SuperController@postText')->name('postText');
				Route::get('swiper', 'SuperController@swiper')->name('swiper');
	        }); 
			
		});		
		
	});

});



